package com.huike.game.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.huike.game.R;

import java.util.ArrayList;

import androidx.appcompat.app.AppCompatActivity;

public class Game18DescImageActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageView iv_left_image;
    private TextView tv_left_text;
    private TextView tv_content_title;
    private ImageView iv_rigth_image;
    private TextView tv_right_text;
    private ImageView tv_game18_t1;
    private ImageView tv_game18_t2;
    private ImageView tv_game18_t3;
    private ImageView tv_game18_t4;
    private  ArrayList<Integer> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_game18_desc_image);
        initView();

        list  = new ArrayList<>();
        list.add(R.drawable.t1);
        list.add(R.drawable.t2);
        list.add(R.drawable.t3);
        list.add(R.drawable.t4);

        tv_game18_t1.setImageResource(list.get(0));
        tv_game18_t2.setImageResource(list.get(1));
        tv_game18_t3.setImageResource(list.get(2));
        tv_game18_t4.setImageResource(list.get(3));




    }

    private void initView() {
        iv_left_image = (ImageView) findViewById(R.id.iv_left_image);
        tv_left_text = (TextView) findViewById(R.id.tv_left_text);
        tv_content_title = (TextView) findViewById(R.id.tv_content_title);
        iv_rigth_image = (ImageView) findViewById(R.id.iv_rigth_image);
        tv_right_text = (TextView) findViewById(R.id.tv_right_text);

        iv_rigth_image.setVisibility(View.GONE);
        tv_right_text.setVisibility(View.GONE);

        tv_content_title.setText("监控抓拍");

        iv_left_image.setImageResource(R.drawable.tiao);

        tv_left_text.setVisibility(View.GONE);

        tv_game18_t1 = (ImageView) findViewById(R.id.tv_game18_t1);
        tv_game18_t1.setOnClickListener(this);
        tv_game18_t2 = (ImageView) findViewById(R.id.tv_game18_t2);
        tv_game18_t2.setOnClickListener(this);
        tv_game18_t3 = (ImageView) findViewById(R.id.tv_game18_t3);
        tv_game18_t3.setOnClickListener(this);
        tv_game18_t4 = (ImageView) findViewById(R.id.tv_game18_t4);
        tv_game18_t4.setOnClickListener(this);
    }


    //    返回按钮点击
    public void toPrePage(View v) {
        finish();
    }

    @Override
    public void onClick(View view) {
        if(view == tv_game18_t1){

            Intent intent = new Intent(Game18DescImageActivity.this, Game18DescImageDescActivity.class);
            intent.putExtra("image",list.get(0));

            startActivity(intent);

        }else if(view == tv_game18_t2){

            Intent intent = new Intent(Game18DescImageActivity.this, Game18DescImageDescActivity.class);
            intent.putExtra("image",list.get(1));
            startActivity(intent);

        }else if(view == tv_game18_t3){
            Intent intent = new Intent(Game18DescImageActivity.this, Game18DescImageDescActivity.class);
            intent.putExtra("image",list.get(2));
            startActivity(intent);

        }else if(view == tv_game18_t4){
            Intent intent = new Intent(Game18DescImageActivity.this, Game18DescImageDescActivity.class);
            intent.putExtra("image",list.get(3));
            startActivity(intent);

        }
    }
}
